function show(title, duration = 2000, mask = false, icon = 'none') {
	if (Boolean(title) === false) {
		return;
	}
	uni.showToast({
		title,
		duration,
		mask,
		icon
	});
}

function loading(title = '加载中') {
	uni.showLoading({
		title: title,
		mask: true
	})
}

function stopIoading(time = 0) {
	setTimeout(() => {
		uni.hideLoading()
	}, time)
}

function prePage(preIndex = 1) {
	const pages = getCurrentPages();
	const prePage = pages[pages.length - (preIndex + 1)];
	return prePage.$vm;
}
export default {show, loading}
